//引入创建仓库方法
import { createStore } from 'redux';
//默认数据源数据，不能直接修改
const defaultStore = {
  count: 1,
};

//reducer出函数
function reducers(state = defaultStore, action: any) {
  if (action.type == 'incr') {
    return {
      count: state.count + 1,
    };
  }
  return state;
}

//创建唯一仓库
const store = createStore(
  reducers,
);
export default store;
